<?php
/**
 * 收藏验证
 */
namespace App\Validation;

use Phalcon\Validation\Validator\PresenceOf;
use Phalcon\Validation\Validator\Numericality;
use Phalcon\Validation\Validator\InclusionIn;

class MemberCollectValidation extends BaseValidation
{
	public function initialize()
    {
		$this->add(
			"list_id",
			new PresenceOf(
				  [
					  "message" => ":field is required",
				  ]
			)
		);

		$this->add(
			"list_id",
			new Numericality(
				  [
					  "message" => ":field is not numeric",
				  ]
			)
		);

		$this->add(
			"table_id",
			new PresenceOf(
				  [
					  "message" => ":field is required",
				  ]
			)
		);

		$this->add(
			"table_id",
			new Numericality(
				  [
					  "message" => ":field is not numeric",
				  ]
			)
		);
	}

	//验证之前
	public function beforeValidation($data, $entity, $messages)
    {
        return true;
    }
}